package pkg

import (
	"bcb-cc-observ/pkg/block"
	"bcb-cc-observ/pkg/models"
	"bcb-cc-observ/pkg/transaction"

	ledgerApi "github.com/hyperledger/fabric-sdk-go/pkg/client/ledger"
)

type S_Ledger struct {
	Client *ledgerApi.Client
}

func NewLedger(client *ledgerApi.Client) *S_Ledger {
	var s S_Ledger
	s.Client = client
	return &s
}
func (s *S_Ledger) GetBlockInfo(blockNumber uint64) (*models.F_Block_Info, error) {
	return block.GetBlockInfo(s.Client, blockNumber)
}
func (s *S_Ledger) GetTransactionInfo(txid string) (*models.F_Transaction_Info, error) {
	return transaction.GetTransactionInfo(s.Client, txid)
}
